package com.cn.chaomeng.enums;

/**
 * @author 范中燊
 * @version V1.0
 * @Title: 订单支付状态
 * @Package ${package_name}
 * @Description: TODO
 * @date ${date} ${time}
 */
public enum PayStateEnums
{
    /**
     * 订单状态:未支付
     */
    NO_PAY_STATE("1000", "未支付"),

    /**
     * 订单状态：已支付
     */
    SUCCESS_PAY_STATE("1001", "订单已完成"),

    /**
     * 订单状态：作废
     */
    FAIL_PAY_STATE("9999", "订单已关闭");


    private String code;
    private String reason;

    PayStateEnums(String code, String reason)
    {
        this.code = code;
        this.reason = reason;
    }

    //通过value获取对应的枚举对象
    public static PayStateEnums getSjjkCode(String code)
    {
        for (PayStateEnums examType : PayStateEnums.values())
        {
            if (examType.getCode().equals(code))
            {
                return examType;
            }
        }
        return null;
    }

    public String getCode()
    {
        return code;
    }

    public String getReason()
    {
        return reason;
    }
}
